<?php

namespace api\models;

use Yii;

/**
 * This is the model class for table "area_dict".
 *
 * @property integer $id
 * @property string $code
 * @property integer $level
 * @property string $full_codes
 * @property string $parent_code
 * @property string $name
 */
class AreaDict extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'area_dict';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('test_3');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id', 'level'], 'integer'],
            [['code', 'full_codes', 'parent_code', 'name'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'code' => 'Code',
            'level' => 'Level',
            'full_codes' => 'Full Codes',
            'parent_code' => 'Parent Code',
            'name' => 'Name',
        ];
    }
}
